<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="学号" prop="studentId">
        <el-input
          v-model="queryParams.studentId"
          placeholder="请输入学号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门" prop="department">
        <el-input
          v-model="queryParams.department"
          placeholder="请输入部门"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="姓名" prop="name">
        <el-input
          v-model="queryParams.name"
          placeholder="请输入姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="性别" prop="gender">
        <el-input
          v-model="queryParams.gender"
          placeholder="请输入性别"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="电话" prop="phone">
        <el-input
          v-model="queryParams.phone"
          placeholder="请输入电话"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="身份证号" prop="idCard">
        <el-input
          v-model="queryParams.idCard"
          placeholder="请输入身份证号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="指导教师姓名" prop="teacherName">
        <el-input
          v-model="queryParams.teacherName"
          placeholder="请输入指导教师姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="指导教师工号" prop="teacherId">
        <el-input
          v-model="queryParams.teacherId"
          placeholder="请输入指导教师工号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="协助人姓名" prop="assistName">
        <el-input
          v-model="queryParams.assistName"
          placeholder="请输入协助人姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="协助人工号" prop="assistId">
        <el-input
          v-model="queryParams.assistId"
          placeholder="请输入协助人工号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="领用单位" prop="applicationDepartment">
        <el-input
          v-model="queryParams.applicationDepartment"
          placeholder="请输入领用单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="仪器编号" prop="instrumentId">
        <el-input
          v-model="queryParams.instrumentId"
          placeholder="请输入仪器编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="仪器名称" prop="instrumentName">
        <el-input
          v-model="queryParams.instrumentName"
          placeholder="请输入仪器名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="型号" prop="modelNumber">
        <el-input
          v-model="queryParams.modelNumber"
          placeholder="请输入型号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="规格" prop="specification">
        <el-input
          v-model="queryParams.specification"
          placeholder="请输入规格"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="单价" prop="unitPrice">
        <el-input
          v-model="queryParams.unitPrice"
          placeholder="请输入单价"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="分类号" prop="classifyNumber">
        <el-input
          v-model="queryParams.classifyNumber"
          placeholder="请输入分类号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="购置日期" prop="purchaseDate">
        <el-date-picker clearable
          v-model="queryParams.purchaseDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择购置日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="领用人工号" prop="receiverId">
        <el-input
          v-model="queryParams.receiverId"
          placeholder="请输入领用人工号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="领用人姓名" prop="receiverName">
        <el-input
          v-model="queryParams.receiverName"
          placeholder="请输入领用人姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="厂家" prop="manufacturers">
        <el-input
          v-model="queryParams.manufacturers"
          placeholder="请输入厂家"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="入库日期" prop="storageDate">
        <el-date-picker clearable
          v-model="queryParams.storageDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择入库日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="存放地名称" prop="storageLocation">
        <el-input
          v-model="queryParams.storageLocation"
          placeholder="请输入存放地名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="经费科目" prop="expenditureSubject">
        <el-input
          v-model="queryParams.expenditureSubject"
          placeholder="请输入经费科目"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="使用方向" prop="useDirection">
        <el-input
          v-model="queryParams.useDirection"
          placeholder="请输入使用方向"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="首次使用" prop="firstUse">
        <el-input
          v-model="queryParams.firstUse"
          placeholder="请输入首次使用"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="开始使用时间" prop="appointmentStart">
        <el-date-picker clearable
          v-model="queryParams.appointmentStart"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择开始使用时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="结束使用时间" prop="appointmentEnd">
        <el-date-picker clearable
          v-model="queryParams.appointmentEnd"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择结束使用时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="提交时间" prop="sbumitTime">
        <el-date-picker clearable
          v-model="queryParams.sbumitTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择提交时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="教师审核结果" prop="teacherResult">
        <el-input
          v-model="queryParams.teacherResult"
          placeholder="请输入教师审核结果"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="领用人审核结果" prop="adminResult">
        <el-input
          v-model="queryParams.adminResult"
          placeholder="请输入领用人审核结果"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
        <el-form-item label="协助人审核结果" prop="assistResult">
          <el-input
            v-model="queryParams.assistResult"
            placeholder="请输入协助人审核结果"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
      <el-form-item label="教师审核时间" prop="teacherTime">
        <el-date-picker clearable
          v-model="queryParams.teacherTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择教师审核时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="管理审核时间" prop="adminTime">
        <el-date-picker clearable
          v-model="queryParams.adminTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择管理审核时间">
        </el-date-picker>
      </el-form-item>
        <el-form-item label="协助人审核时间" prop="assistTime">
          <el-date-picker clearable
                          v-model="queryParams.assistTime"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="请选择协助人审核时间">
          </el-date-picker>
        </el-form-item>
      <el-form-item label="用户ID" prop="userId">
        <el-input
          v-model="queryParams.userId"
          placeholder="请输入用户ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门ID" prop="deptId">
        <el-input
          v-model="queryParams.deptId"
          placeholder="请输入部门ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建者" prop="createBy">
        <el-input
          v-model="queryParams.createBy"
          placeholder="请输入创建者"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建时间" prop="createTime">
        <el-date-picker clearable
          v-model="queryParams.createTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择创建时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="更新者" prop="updateBy">
        <el-input
          v-model="queryParams.updateBy"
          placeholder="请输入更新者"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="更新时间" prop="updateTime">
        <el-date-picker clearable
          v-model="queryParams.updateTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择更新时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="备注1" prop="note1">
        <el-input
          v-model="queryParams.note1"
          placeholder="请输入备注1"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注2" prop="note2">
        <el-input
          v-model="queryParams.note2"
          placeholder="请输入备注2"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注3" prop="note3">
        <el-input
          v-model="queryParams.note3"
          placeholder="请输入备注3"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注4" prop="note4">
        <el-input
          v-model="queryParams.note4"
          placeholder="请输入备注4"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注5" prop="note5">
        <el-input
          v-model="queryParams.note5"
          placeholder="请输入备注5"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注6" prop="note6">
        <el-input
          v-model="queryParams.note6"
          placeholder="请输入备注6"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注7" prop="note7">
        <el-input
          v-model="queryParams.note7"
          placeholder="请输入备注7"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注8" prop="note8">
        <el-input
          v-model="queryParams.note8"
          placeholder="请输入备注8"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注9" prop="note9">
        <el-input
          v-model="queryParams.note9"
          placeholder="请输入备注9"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注10" prop="note10">
        <el-input
          v-model="queryParams.note10"
          placeholder="请输入备注10"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['project:appointment:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['project:appointment:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['project:appointment:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['project:appointment:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="appointmentList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="ID" align="center" prop="id" />
      <el-table-column label="学号" align="center" prop="studentId" />
      <el-table-column label="部门" align="center" prop="department" />
      <el-table-column label="姓名" align="center" prop="name" />
      <el-table-column label="性别" align="center" prop="gender" />
      <el-table-column label="电话" align="center" prop="phone" />
      <el-table-column label="身份证号" align="center" prop="idCard" />
      <el-table-column label="指导教师姓名" align="center" prop="teacherName" />
      <el-table-column label="指导教师工号" align="center" prop="teacherId" />
      <el-table-column label="协助人姓名" align="center" prop="assistName" />
      <el-table-column label="协助人工号" align="center" prop="assistId" />
      <el-table-column label="设备类别" align="center" prop="equipmentType" />
      <el-table-column label="领用单位" align="center" prop="applicationDepartment" />
      <el-table-column label="仪器编号" align="center" prop="instrumentId" />
      <el-table-column label="仪器名称" align="center" prop="instrumentName" />
      <el-table-column label="型号" align="center" prop="modelNumber" />
      <el-table-column label="规格" align="center" prop="specification" />
      <el-table-column label="单价" align="center" prop="unitPrice" />
      <el-table-column label="分类号" align="center" prop="classifyNumber" />
      <el-table-column label="购置日期" align="center" prop="purchaseDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.purchaseDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="领用人工号" align="center" prop="receiverId" />
      <el-table-column label="领用人姓名" align="center" prop="receiverName" />
      <el-table-column label="厂家" align="center" prop="manufacturers" />
      <el-table-column label="入库日期" align="center" prop="storageDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.storageDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="存放地名称" align="center" prop="storageLocation" />
      <el-table-column label="经费科目" align="center" prop="expenditureSubject" />
      <el-table-column label="使用方向" align="center" prop="useDirection" />
      <el-table-column label="首次使用" align="center" prop="firstUse" />
      <el-table-column label="开始使用时间" align="center" prop="appointmentStart" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.appointmentStart, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="结束使用时间" align="center" prop="appointmentEnd" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.appointmentEnd, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="提交时间" align="center" prop="sbumitTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.sbumitTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="审核状态" align="center" prop="auditStatus" />
      <el-table-column label="教师审核结果" align="center" prop="teacherResult" />
      <el-table-column label="领用人审核结果" align="center" prop="adminResult" />
      <el-table-column label="协助人审核结果" align="center" prop="assistResult" />
      <el-table-column label="教师审核时间" align="center" prop="teacherTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.teacherTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="管理审核时间" align="center" prop="adminTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.adminTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="协助人审核时间" align="center" prop="assistTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.assistTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="用户ID" align="center" prop="userId" />
      <el-table-column label="部门ID" align="center" prop="deptId" />
      <el-table-column label="创建者" align="center" prop="createBy" />
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="更新者" align="center" prop="updateBy" />
      <el-table-column label="更新时间" align="center" prop="updateTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="备注1" align="center" prop="note1" />
      <el-table-column label="备注2" align="center" prop="note2" />
      <el-table-column label="备注3" align="center" prop="note3" />
      <el-table-column label="备注4" align="center" prop="note4" />
      <el-table-column label="备注5" align="center" prop="note5" />
      <el-table-column label="备注6" align="center" prop="note6" />
      <el-table-column label="备注7" align="center" prop="note7" />
      <el-table-column label="备注8" align="center" prop="note8" />
      <el-table-column label="备注9" align="center" prop="note9" />
      <el-table-column label="备注10" align="center" prop="note10" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['project:appointment:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['project:appointment:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改预约信息对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="学号" prop="studentId">
          <el-input v-model="form.studentId" placeholder="请输入学号" />
        </el-form-item>
        <el-form-item label="部门" prop="department">
          <el-input v-model="form.department" placeholder="请输入部门" />
        </el-form-item>
        <el-form-item label="姓名" prop="name">
          <el-input v-model="form.name" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="性别" prop="gender">
          <el-input v-model="form.gender" placeholder="请输入性别" />
        </el-form-item>
        <el-form-item label="电话" prop="phone">
          <el-input v-model="form.phone" placeholder="请输入电话" />
        </el-form-item>
        <el-form-item label="身份证号" prop="idCard">
          <el-input v-model="form.idCard" placeholder="请输入身份证号" />
        </el-form-item>
        <el-form-item label="指导教师姓名" prop="teacherName">
          <el-input v-model="form.teacherName" placeholder="请输入指导教师姓名" />
        </el-form-item>
        <el-form-item label="指导教师工号" prop="teacherId">
          <el-input v-model="form.teacherId" placeholder="请输入指导教师工号" />
        </el-form-item>
        <el-form-item label="协助人姓名" prop="assistName">
          <el-input v-model="form.assistName" placeholder="请输入协助人姓名" />
        </el-form-item>
        <el-form-item label="协助人工号" prop="assistId">
          <el-input v-model="form.assistId" placeholder="请输入协助人工号" />
        </el-form-item>
        <el-form-item label="领用单位" prop="applicationDepartment">
          <el-input v-model="form.applicationDepartment" placeholder="请输入领用单位" />
        </el-form-item>
        <el-form-item label="仪器编号" prop="instrumentId">
          <el-input v-model="form.instrumentId" placeholder="请输入仪器编号" />
        </el-form-item>
        <el-form-item label="仪器名称" prop="instrumentName">
          <el-input v-model="form.instrumentName" placeholder="请输入仪器名称" />
        </el-form-item>
        <el-form-item label="型号" prop="modelNumber">
          <el-input v-model="form.modelNumber" placeholder="请输入型号" />
        </el-form-item>
        <el-form-item label="规格" prop="specification">
          <el-input v-model="form.specification" placeholder="请输入规格" />
        </el-form-item>
        <el-form-item label="单价" prop="unitPrice">
          <el-input v-model="form.unitPrice" placeholder="请输入单价" />
        </el-form-item>
        <el-form-item label="分类号" prop="classifyNumber">
          <el-input v-model="form.classifyNumber" placeholder="请输入分类号" />
        </el-form-item>
        <el-form-item label="购置日期" prop="purchaseDate">
          <el-date-picker clearable
            v-model="form.purchaseDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择购置日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="领用人工号" prop="receiverId">
          <el-input v-model="form.receiverId" placeholder="请输入领用人工号" />
        </el-form-item>
        <el-form-item label="领用人姓名" prop="receiverName">
          <el-input v-model="form.receiverName" placeholder="请输入领用人姓名" />
        </el-form-item>
        <el-form-item label="厂家" prop="manufacturers">
          <el-input v-model="form.manufacturers" placeholder="请输入厂家" />
        </el-form-item>
        <el-form-item label="入库日期" prop="storageDate">
          <el-date-picker clearable
            v-model="form.storageDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择入库日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="存放地名称" prop="storageLocation">
          <el-input v-model="form.storageLocation" placeholder="请输入存放地名称" />
        </el-form-item>
        <el-form-item label="经费科目" prop="expenditureSubject">
          <el-input v-model="form.expenditureSubject" placeholder="请输入经费科目" />
        </el-form-item>
        <el-form-item label="使用方向" prop="useDirection">
          <el-input v-model="form.useDirection" placeholder="请输入使用方向" />
        </el-form-item>
        <el-form-item label="首次使用" prop="firstUse">
          <el-input v-model="form.firstUse" placeholder="请输入首次使用" />
        </el-form-item>
        <el-form-item label="开始使用时间" prop="appointmentStart">
          <el-date-picker clearable
            v-model="form.appointmentStart"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择开始使用时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="结束使用时间" prop="appointmentEnd">
          <el-date-picker clearable
            v-model="form.appointmentEnd"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择结束使用时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="提交时间" prop="sbumitTime">
          <el-date-picker clearable
            v-model="form.sbumitTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择提交时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="教师审核结果" prop="teacherResult">
          <el-input v-model="form.teacherResult" placeholder="请输入教师审核结果" />
        </el-form-item>
        <el-form-item label="领用人审核结果" prop="adminResult">
          <el-input v-model="form.adminResult" placeholder="请输入领用人审核结果" />
        </el-form-item>
        <el-form-item label="协助人审核结果" prop="assistResult">
          <el-input v-model="form.assistResult" placeholder="请输入协助人审核结果" />
        </el-form-item>
        <el-form-item label="教师审核时间" prop="teacherTime">
          <el-date-picker clearable
            v-model="form.teacherTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择教师审核时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="管理审核时间" prop="adminTime">
          <el-date-picker clearable
            v-model="form.adminTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择管理审核时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="协助人审核时间" prop="assistTime">
          <el-date-picker clearable
                          v-model="form.assistTime"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="请选择协助人审核时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="用户ID" prop="userId">
          <el-input v-model="form.userId" placeholder="请输入用户ID" />
        </el-form-item>
        <el-form-item label="部门ID" prop="deptId">
          <el-input v-model="form.deptId" placeholder="请输入部门ID" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注1" prop="note1">
          <el-input v-model="form.note1" placeholder="请输入备注1" />
        </el-form-item>
        <el-form-item label="备注2" prop="note2">
          <el-input v-model="form.note2" placeholder="请输入备注2" />
        </el-form-item>
        <el-form-item label="备注3" prop="note3">
          <el-input v-model="form.note3" placeholder="请输入备注3" />
        </el-form-item>
        <el-form-item label="备注4" prop="note4">
          <el-input v-model="form.note4" placeholder="请输入备注4" />
        </el-form-item>
        <el-form-item label="备注5" prop="note5">
          <el-input v-model="form.note5" placeholder="请输入备注5" />
        </el-form-item>
        <el-form-item label="备注6" prop="note6">
          <el-input v-model="form.note6" placeholder="请输入备注6" />
        </el-form-item>
        <el-form-item label="备注7" prop="note7">
          <el-input v-model="form.note7" placeholder="请输入备注7" />
        </el-form-item>
        <el-form-item label="备注8" prop="note8">
          <el-input v-model="form.note8" placeholder="请输入备注8" />
        </el-form-item>
        <el-form-item label="备注9" prop="note9">
          <el-input v-model="form.note9" placeholder="请输入备注9" />
        </el-form-item>
        <el-form-item label="备注10" prop="note10">
          <el-input v-model="form.note10" placeholder="请输入备注10" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listAppointment, getAppointment, delAppointment, addAppointment, updateAppointment } from "@/api/project/appointment";

export default {
  name: "Appointment",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 预约信息表格数据
      appointmentList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        studentId: null,
        department: null,
        name: null,
        gender: null,
        phone: null,
        idCard: null,
        teacherName: null,
        teacherId: null,
        assistName: null,
        assistId: null,
        equipmentType: null,
        applicationDepartment: null,
        instrumentId: null,
        instrumentName: null,
        modelNumber: null,
        specification: null,
        unitPrice: null,
        classifyNumber: null,
        purchaseDate: null,
        receiverId: null,
        receiverName: null,
        manufacturers: null,
        storageDate: null,
        storageLocation: null,
        expenditureSubject: null,
        useDirection: null,
        firstUse: null,
        appointmentStart: null,
        appointmentEnd: null,
        sbumitTime: null,
        auditStatus: null,
        teacherResult: null,
        assistResult: null,
        adminResult: null,
        teacherTime: null,
        adminTime: null,
        assistTime: null,
        userId: null,
        deptId: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询预约信息列表 */
    getList() {
      this.loading = true;
      listAppointment(this.queryParams).then(response => {
        this.appointmentList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        studentId: null,
        department: null,
        name: null,
        gender: null,
        phone: null,
        idCard: null,
        teacherName: null,
        teacherId: null,
        assistName: null,
        assistId: null,
        equipmentType: null,
        applicationDepartment: null,
        instrumentId: null,
        instrumentName: null,
        modelNumber: null,
        specification: null,
        unitPrice: null,
        classifyNumber: null,
        purchaseDate: null,
        receiverId: null,
        receiverName: null,
        manufacturers: null,
        storageDate: null,
        storageLocation: null,
        expenditureSubject: null,
        useDirection: null,
        firstUse: null,
        appointmentStart: null,
        appointmentEnd: null,
        sbumitTime: null,
        auditStatus: null,
        teacherResult: null,
        adminResult: null,
        assistResult: null,
        teacherTime: null,
        adminTime: null,
        assistTime: null,
        userId: null,
        deptId: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加预约信息";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getAppointment(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改预约信息";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateAppointment(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addAppointment(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除预约信息编号为"' + ids + '"的数据项？').then(function() {
        return delAppointment(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('project/appointment/export', {
        ...this.queryParams
      }, `appointment_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
